from selenium.webdriver.common.by import By

from base.page_base import PageBase


class AddBuy(PageBase):
    click_cart_01=(By.XPATH,'//android.widget.TextView[@resource-id="com.netease.yanxuan:id/txt_mainpage_tab_title" and @text="购物车"]')
    click_purchase_02=(By.XPATH,'//androidx.compose.ui.platform.ComposeView/android.view.View/android.view.View/android.view.View[5]')
    click_send_03=(By.XPATH,'//android.widget.TextView[@resource-id="com.netease.yanxuan:id/order_btn"]')
    click_personage_04=(By.XPATH,'//android.widget.TextView[@text="个人"]')
    click_order_05=(By.XPATH,'(//android.widget.ImageView[@resource-id="com.netease.yanxuan:id/order_icon"])[1]')
    click_get_text_06=(By.XPATH,'(//android.widget.TextView[@resource-id="com.netease.yanxuan:id/tv_commodity_name"])[1]')
    def click_add(self):
        self.base_click(self.click_cart_01)
        self.base_click(self.click_purchase_02)
        self.base_click(self.click_send_03)

    def click_title(self):
        self.base_click(self.click_personage_04)
        self.base_click(self.click_order_05)
    def get_text(self):
        return self.base_get_text(self.click_get_text_06)
